package inner_class;

public class Parcel5 {

    //局部内部类
    public Destination getDestination(String label){
        class Inner implements Destination{
            private String label;

            public Inner(String label) {
                this.label = label;
            }

            @Override
            public String readLabel() {
                return this.label;
            }
        }
        return new Inner(label);
    }

    public static void main(String[] args) {
        Parcel5 parcel5 = new Parcel5();
        Destination sb = parcel5.getDestination("sb");
        System.out.println(sb.readLabel());
    }

}

interface Destination {

    String readLabel();
}